/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pardal.core;

import java.util.ArrayList;

/**
 *
 * @author Valdigleis
 */
public class Nodo {
    
    private String label;
    
    private int level;
    
    private String fatherLabel;
    
    private ArrayList<String> sons;

    public Nodo(String label) {
        this.label = label;
        this.sons = new ArrayList<>();
        calcLevel();
    }
    
    private void calcLevel(){
        int cont = 0;
        String testCharacter = ".|";
        for(int  i = 0; i < this.label.length(); i++){
            if(this.label.charAt(i) == testCharacter.charAt(0) || this.label.charAt(i) == testCharacter.charAt(1)){
                cont++;
            }
        }
        setLevel(cont);
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getFatherLabel() {
        return fatherLabel;
    }

    public void setFatherLabel(String fatherLabel) {
        this.fatherLabel = fatherLabel;
    }

    public ArrayList<String> getSons() {
        return sons;
    }

    public void setSons(ArrayList<String> sons) {
        this.sons = sons;
    }
    
}
